import storeUtils from "utils/StoreUtils";

let routeInfos = {};
let menus = storeUtils.getStore("menus");
//以菜单名为key，单个菜单实例为value的对象
const initRouteInfos = (routeInfos, menus) => {
	if (menus && menus.length > 0) {
		for (let menu of menus) {
			if (menu.path) {
				routeInfos[menu.name] = menu;
			} else {
				initRouteInfos(routeInfos, menu.children);
			}
		}
	}
};
initRouteInfos(routeInfos, menus);

export default routeInfos;
